import request from '@/utils/request'

// 查询用户记录列表
export function listUserAnswer(query) {
  return request({
    url: '/question/userAnswer/list',
    method: 'get',
    params: query
  })
}

// 查询用户记录详细
export function getUserAnswer(id) {
  return request({
    url: '/question/userAnswer/' + id,
    method: 'get'
  })
}

// 新增用户记录
export function addUserAnswer(data) {
  return request({
    url: '/question/userAnswer',
    method: 'post',
    data: data
  })
}

// 修改用户记录
export function updateUserAnswer(data) {
  return request({
    url: '/question/userAnswer',
    method: 'put',
    data: data
  })
}

// 删除用户记录
export function delUserAnswer(id) {
  return request({
    url: '/question/userAnswer/' + id,
    method: 'delete'
  })
}

//获取用户数据记录

export function tablestatistics(data) {
  return request({
    url: '/questionStatistics/tablestatistics',
    method: 'post',
    data:data
  })
}

//浏览量和答题人数接口
export function participateCount() {
  return request({
    url: '/questionStatistics/participateCount/',
    method: 'get'
  })
}

//导出统计
export function exportStatistics(data) {
  return request({
    url: '/questionStatistics/exportStatistics/',
    method: 'post',
    data:data
  })
}

//获取题目list
export function selectListQuestion() {
  return request({
    url: '/question/question/selectList',
    method: 'get',
  })
}

export function getInfoByQuestionId(id) {
  return request({
    url: `/question/content/getInfoByQuestionId/${id}`,
    method: 'get',
  })
}


export function getRegionTreeSelect() {
  return request({
    url: `/region/region/getRegionTreeSelect`,
    method: 'get',
  })
}

export function getRegionList() {
  return request({
    url: '/region/region/getRegionList',
    method: 'get'
  })
}

export function getPlotList(plotId) {
  return request({
    url: `/region/region/getPlotList/${plotId}`,
    method: 'get'
  })
}
